import request from '@/utils/request'

export function getInventoryByPage(query) {
  return request({
    url: '/mall/api/supplier/inventory',
    method: 'get',
    params: query
  })
}

export function addInventory(data) {
  return request({
    url: '/mall/api/supplier/inventory',
    method: 'post',
    data
  })
}

export function getInventoryById(id) {
  return request({
    url: '/mall/api/supplier/inventory/' + id,
    method: 'get'
  })
}

export function putInventoryById(id, data) {
  return request({
    url: '/mall/api/supplier/inventory/' + id,
    method: 'put',
    data
  })
}

export function deleteInventoryById(id) {
  return request({
    url: '/mall/api/supplier/inventory/' + id,
    method: 'delete'
  })
}

export function uploadInventory(param) {
  return request({
    url: '/mall/api/supplier/inventory/upload',
    method: 'post',
    data: param,
    timeout: 60000
  })
}
